import Vue from 'vue';
import VueRouter from 'vue-router';
import Index from '../views/index/index.vue';
import IndexView from '../views/index/view.vue';

Vue.use(VueRouter);

const Jiaqi     = r => require.ensure([], () => r(require('../views/jiaqi/index.vue')), 'Jiaqi');
const Help      = r => require.ensure([], () => r(require('../views/help/Index.vue')), 'Help');
const HelpChildDefault    = r => require.ensure([], () => r(require('../views/help/HelpChildDefault.vue')), 'HelpChildDefault');
const HelpChild01    = r => require.ensure([], () => r(require('../views/help/HelpChild01.vue')), 'HelpChild01');
const HelpChild02    = r => require.ensure([], () => r(require('../views/help/HelpChild02.vue')), 'HelpChild02');
const HelpChild03    = r => require.ensure([], () => r(require('../views/help/HelpChild03.vue')), 'HelpChild03');
const HelpChild04    = r => require.ensure([], () => r(require('../views/help/HelpChild04.vue')), 'HelpChild04');
const HelpChild05    = r => require.ensure([], () => r(require('../views/help/HelpChild05.vue')), 'HelpChild05');



const routes = [
    //签到规则
    {
        name: 'index',
        path: '/rule',
        component:  Index,
        children : [
            {  path: '/', component:  IndexView },
            {  path: ':id',  component:  IndexView },
            {  path: ':id/:edit',  component:  IndexView }
        ]
    },
    {
        path: '/jiaqi',
        name: 'jiaqi',
        component:  Jiaqi,
    },

    //签到帮助
    {
        name: 'help',
        path: '/help',
        component:  Help,
        children : [
            { path:'/', component: HelpChildDefault },
            { path:'01', component:  HelpChild01 },
            { path:'02', component: HelpChild02 },
            { path:'03', component: HelpChild03 },
            { path:'04', component: HelpChild04 },
            { path:'05', component: HelpChild05 },
        ]
    },
];

Vue.use(VueRouter);
const router = new VueRouter({
    routes,
});
export default router;